@extends('home.base.info')
@section('content')
	
<div class="uc-box uc-main-box">
	<div class="uc-content-box order-list-box">
		<div class="box-hd">
			<h1 class="title">
				我的订单
				<small>
				请谨防钓鱼链接或诈骗电话
				<!-- <a href="#" target="_blank" data-stat-id="78d07fef654ba47a">了解更多></a> -->
				</small>
			</h1>
			<div class="more clearfix">
				<ul class="filter-list J_orderType">
				
			<form action="" method="post" id="myformss">
				<input type="hidden" name="_token" value="{{ csrf_token() }}">
				<input type="hidden" name="_method" value="DELETE" >
			</form>
			<form action='' method='get'>
			        <div class='media-body'>
			            收货人：<input type='text' class='form-control m-b-5' name='name'>
			        </div>
			        <div style="margin-left:250px;margin-top:-25px">
			        	<input type='submit' class='btn-sm' value='搜索'>
			        </div>
			</form>
			<form action="{{ url('home/pilun') }}" menthod="post">
	            <table  border=1 width=800 height=400>
	                <thead>
	                    <tr>
	                        <th>订单号</th>
	                        <th>商品详情</th>
	                        <th>收货人</th>
	                        <th>联系方式</th>
	                        <th>收货地址</th>
	                        <th>订单物流</th>
	                        
	                    </tr>
	                </thead>
	                <tbody>
	                @foreach($list as $v)
	                    <tr>
	                        <td>{{ $v->id }}</td>
	                        <td>{{ $v->detail }}</td>
	                        <td>{{ $v->name }}</td>
	                        <td>{{ $v->phone }}</td>
	                        <td>{{ $v->address }}</td>
	                        <td>
		                       	@if($v->state == 1)
									未付款 | <a href="javascript:doDel({{ $v->id }})">删除</a>
		                       	@endif
		                       	@if($v->state != 1)
									已付款,正在发货 | <a class="aid">去评论</a>
		                       	@endif  	
	                        </td>
	                        
	                    </tr>
	                    <input type="hidden" name="goodsid" value="{{ $v->goodsid }}" >
	                    <input type="hidden" name="userid" value="{{ $v->uid }}" >
	                @endforeach 
	                </tbody>
	            </table>
	            <div style="display:none" id="did">
	            	
	            		<input type="hidden" name="_token" value="{{ csrf_token() }}">
		            	
		            	<input type="text" style="width:750px;height:200px" name="content">
						<input type="submit" class="btn" value="提交评论">
					</form>
	            </div>
	         <script type="text/javascript">
						$(".aid").click(function(){
							$('#did').slideToggle();
						});
					function doDel(id){
						if(confirm("是否取消？")){
							var a = document.getElementById("myformss");
							a.action = "{{ url('/home/order') }}/"+id;
							a.submit();
						}
					}
					
			</script>
	{{ $list->appends($where)->links() }}
			</div>
		</div>
	</div>
</div>

@stop